package javabean.book;

import java.util.List;

public interface BookDAO {
	//录入书本信息
	public int insert(Book book) throws Exception ;
	//编辑书本信息
	public boolean edit(Book book) throws Exception ;
	//删除图书
	public boolean deleteByBid(Long bid) throws Exception ;
	//查询书籍详细信息
	public List<Book> queryAllBookByBid(String bid) throws Exception ;
	//查询所有图书
	public List<Book> queryAllBook() throws Exception;
	//模糊查询书籍总条数
	public int queryCountBookByLike(String keyword) throws Exception;
	//分段模糊查询
	public List<Book> queryAllBookByLike(String keyword,int index, int count) throws Exception ;
	//根据图书类型查询书籍总条数
	public int queryCountBookByType(String type) throws Exception ;
	//根据图书类型分段查询
	public List<Book> queryAllBookByType(String type,int index, int count) throws Exception ;
	//查询用户个人图书
	public List<Book> queryAllBookByUid(String uid) throws Exception ;
	//查询用户所借图书
	public List<Book> queryDebitBookByUid(String uid) throws Exception ;
	//查询图书分类
	public List<BookTag> queryAllBookTag() throws Exception ;
	//更新图书分类访问数量
	public boolean updateBookTagReadCount(String tagname) throws Exception ;
	//查询图书全部回复内容（评分）
	public List<BookComment> queryBookCommentByBid(String bid) throws Exception;
	//查询图书对应用户单条回复内容（评分）
	public List<BookComment> queryBookCommentByBidAndUid(String bid,String uid) throws Exception;
	//图书评分
	public boolean giveBookScore(BookComment bookComment) throws Exception;
	//删除图书评分
	public boolean deleteBookScore(String bid,String uid) throws Exception;
	//检查是否已评分
	public boolean isGivedScore(String uid,Long bid) throws Exception;
	//图书评论
	public long giveBookComment(BookComment bookComment) throws Exception;
	//删除图书评论
	public boolean deleteBookComment(String bcid) throws Exception;
	//更改图书审核状态
	public boolean changeBookIsCheck(String bid,int ischeck) throws Exception;
}
